Algo NVM Functions

ee_status EE_NVM_Init ( ee_object_t * object )

Initialize the eeprom emulation and all used interfaces.

Processing

The following graph shows the processing of EE_NVM_Init:

Parameters :

object – pointer on eeprom_emulation object

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_ERROR_ALGO: if an error occurred during initialization

ee_status EE_NVM_Format ( ee_erase_type erase_type )

Format all NVM pages allocated for eeprom emulation.

Processing

The following graph shows the processing of EE_NVM_Format():

Note

This function can be called the very first time eeprom emulation is used, to prepare NVM pages for eeprom emulation with empty eeprom variables. It can also be called at any time, to flush all eeprom variables.

Parameters :

erase_type – /ref ee_erase_type Type of erase to apply on page requiring to be erased.

Return values :

ee_status – /ref ee_status

  • EE_OK: operation finished successfully

  • EE_ERROR_ALGO: if an error occurred during memory formatting

ee_status EE_NVM_ReadVariable8bits ( uint16_t virt_address , uint8_t * p_data )

Returns the last stored variable data, if found, which correspond to the passed virtual address.

Processing

The following graph shows the processing of EE_NVM_ReadVariable8bits():

Parameters :
  • virt_address – Variable virtual address on 16 bits

  • p_data – 8bits data to be written

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_INFO_NODATA: if no valid data found

ee_status EE_NVM_ReadVariable16bits ( uint16_t virt_address , uint16_t * p_data )

Returns the last stored variable data, if found, which correspond to the passed virtual address.

Processing

The following graph shows the processing of EE_NVM_ReadVariable16bits:

Parameters :
  • virt_address – Variable virtual address on 16 bits

  • p_data – 16bits data to be written

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_INFO_NODATA: if no valid data found

ee_status EE_NVM_ReadVariable32bits ( uint16_t virt_address , uint32_t * p_data )

Returns the last stored variable data, if found, which correspond to the passed virtual address.

Processing

The following graph shows the processing of EE_NVM_ReadVariable32bits:

Parameters :
  • virt_address – Variable virtual address on 16 bits (can’t be 0x0000 or 0xFFFF)

  • p_data – 32bits data to be written

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_INFO_NODATA: if no valid data found

ee_status EE_NVM_WriteVariable8bits ( uint16_t virt_address , uint8_t data )

Writes/updates variable data in EEPROM.

Processing

The following graph shows the processing of EE_NVM_WriteVariable8bits:

Warning

This function is not reentrant

Parameters :
  • virt_address – Variable virtual address on 16 bits

  • data – 8bits data to be written

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_ERROR_ALGO: if an error occurred

ee_status EE_NVM_WriteVariable16bits ( uint16_t virt_address , uint16_t data )

Writes/updates variable data in EEPROM.

Processing

The following graph shows the processing of EE_NVM_WriteVariable16bits:

Warning

This function is not reentrant

Parameters :
  • virt_address – Variable virtual address on 16 bits

  • data – 16bits data to be written

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_ERROR_ALGO: if an error occurred

ee_status EE_NVM_WriteVariable32bits ( uint16_t virt_address , uint32_t data )

Writes/updates variable data in EEPROM.

Processing

The following graph shows the processing of EE_NVM_WriteVariable32bits:

Warning

This function is not reentrant

Parameters :
  • virt_address – Variable virtual address on 16 bits

  • data – 32bits data to be written

Return values :

ee_status – refer to ee_status

  • EE_OK: operation finished successfully

  • EE_ERROR_ALGO: if an error occurred